--
-- Game Over
--

local storyboard = require( "storyboard" )
local scene = storyboard.newScene()
local MenuUtils = require 'scripts.utils.MenuUtils'
local menuUtils = MenuUtils.new()

function scene:createScene( event )
   storyboard.removeAll()
   local group = self.view
end

function scene:enterScene( event )
   local group = self.view
   local timeNum = 10
   local background = display.newImageRect( "resources/sprites/gameoverBG.jpg", X, Y )
   background.x = X*0.5
   background.y = Y*0.5

   -- local continueLabel = display.newText({
   --     parent = group,
   --     text = "Continue ?",
   --     width = X*0.9,
   --     x = X*0.5,
   --     y = Y*0.2,
   --     font = Font.get('seagram'),
   --     fontSize = 40,
   --     align = "center"
   -- })

   local continueBtn = menuUtils:createButton(X*0.5, Y*0.7, "RETRY", function ()
      storyboard.gotoScene("scripts.scenes.GridTestScene", {effect = "fade",time = 100})
      return true
   end)
   
   local menuBtn = menuUtils:createButton(X*0.5, Y*0.9, "QUIT", function ()
      storyboard.gotoScene("scripts.scenes.menu", {effect = "fade",time = 100})
      return true
   end)

   group:insert( background )
   -- group:insert( continueLabel )
   group:insert( continueBtn )
   group:insert( menuBtn )
end

function scene:exitScene( event )
   local group = self.view
end

function scene:destroyScene( event )
   local group = self.view
end

scene:addEventListener( "createScene", scene )
scene:addEventListener( "enterScene", scene )
scene:addEventListener( "exitScene", scene )
scene:addEventListener( "destroyScene", scene )

return scene
